﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data.SqlServerCe;

namespace WindowsFormsApplication1
{
    public partial class bills : Form
    {
        public bills()
        {
            InitializeComponent();

            string connString = "Data Source=|DataDirectory|\\Model\\Database1.sdf";
            string query = "SELECT Date,Name,OnMonths,Shovar,Price FROM bills WHERE apartmentID=" + Globals.dept + "AND Type=" + Globals.billtype;

            BindingSource bS = new BindingSource();
            bS.DataSource = Controller.Control.Select(query, connString);
            dgv01.DataSource = bS; 
        }

        private void btn_back_Click(object sender, EventArgs e)
        {
            Form billsm = new billsMenu();
            billsm.Owner = this;
            billsm.Show();
            this.Hide();
        }

        private void btn_pay_Click(object sender, EventArgs e)
        {
            newbill1.Show();
            btn_pay.Visible = false;
        }
    }
}
